package com.easybuy.Tools;

import com.easybuy.pojo.Product;

import java.util.List;

public class Page<T> {
    private Integer pageNow;//当前页数
    private Integer pageMax;//总页数
    private Integer pageStart;//开始位置
    private Integer pageCount;//总条数
    private Integer pageSize;//页面显示数量
    private String orderBy;//排序条件
    private String order;//排序方向
    private List<T> list;

    public Integer getPageNow() {
        return pageNow;
    }

    public void setPageNow(Integer pageNow) {
        this.pageNow = pageNow;
    }

    public Integer getPageMax() {
        return pageMax;
    }

    public void setPageMax(Integer pageMax) {
        this.pageMax = pageMax;
    }

    public Integer getPageCount() {
        return pageCount;
    }

    public void setPageCount(Integer pageCount) {
        this.pageMax=pageCount%pageSize==0?pageCount/pageSize:pageCount/pageSize+1;
        this.pageStart=(pageNow-1)*pageSize;
        this.pageCount = pageCount;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }


    public Integer getPageStart() {
        return pageStart;
    }

    public void setPageStart(Integer pageStart) {
        this.pageStart = pageStart;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }
}
